package ssm.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ssm.dao.DepartmentMapper;
import ssm.entity.Department;

@Service
public class DepartmentService {

	@Autowired
	private DepartmentMapper departmentMapper;
	
	/**
	 * 获取院系
	 * @param record
	 * @return
	 */
	public Department getDepartmentByName(Department record) {
		return departmentMapper.getDepartmentByName(record);
	}
	
	/**
	 * 查询所有院系
	 * @return
	 */
	public List<Department> allDepartment(){
		
		return departmentMapper.allDepartment();
	}
	
	/**
	 * 添加院系
	 * @param record
	 * @return
	 */
	public int addDepartment(Department record) {
		return departmentMapper.addDepartment(record);
	}
	
	/**
	 * 修改院系
	 * @param record
	 * @return
	 */
	public int updateDepartment(Department record) {
		return departmentMapper.updateDepartment(record);
	}
	
	
}
